import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import 'package:get/get.dart';

import '../../../routes/app_pages.dart';
import '../../../style/app_colors.dart';
import '../controllers/mine_wifi_setting_controller.dart';

class MineWifiSettingView extends GetView<MineWifiSettingController> {
  const MineWifiSettingView({super.key});
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('机器人Wi-Fi设置'),
        centerTitle: true,
        leading: IconButton(
          icon: Image.asset('assets/images/ic_back2.png',width: 48.w,height: 48.h),
          onPressed: () {
            Get.back();
          },
          tooltip: MaterialLocalizations.of(context).backButtonTooltip, // 可选：设置工具提示
        ),
      ),
      body: Obx(()=>Container(
        margin:EdgeInsets.only(left: 40.w,right: 40.w,top: 40.h),
        child: Column(
          children: [
            SizedBox(height: 60.h,),
            Row(
              children: [
                Text('机器人当前Wi-Fi',style: TextStyle(fontSize: 28.sp,color: AppColors.Sub_Title_Color),),

              ],
            ),
            SizedBox(height: 20.h,),
            Container(
              padding: EdgeInsets.only(top: 23.h,bottom: 23.h,left: 30.w,right: 30.w),
              decoration: BoxDecoration(
                  borderRadius: BorderRadius.all(Radius.circular(16)),
                  color: Colors.white
              ),
              child: Row(
                children: [
                  Text('${controller.robotResponse.value.wifiname}',style: TextStyle(fontSize: 32.sp),)
                ],
              ),
            ),

            SizedBox(height: 40.h,),
            GestureDetector(
              onTap: () {
                 Get.toNamed(Routes.WIFI_SETTING2);
              },
              child: Container(
                padding: EdgeInsets.only(top: 23.h,bottom: 23.h,left: 30.w,right: 30.w),
                decoration: BoxDecoration(
                    borderRadius: BorderRadius.all(Radius.circular(16)),
                    color: Colors.white
                ),
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    Text('切换机器人Wi-Fi',style: TextStyle(fontSize: 32.sp,color: Colors.blue),)
                  ],
                ),
              ),
            ),


          ],
        ),
      )),
    );
  }
}
